<?php

include_once("accesscontrol.php");
include_once "index.php";

if (isset($_POST[s1])) {
	$q1 = "update job_settings set
					paypal = '$_POST[pp]',
					adsense = '$_POST[adsense]',
					faq = '$_POST[faq]',
					about = '$_POST[about]',
                    tips = '$_POST[tips]',
					privacy = '$_POST[privacy]',
					counters = '$_POST[counters]',
					ContactEmail = '$_POST[ce]'";
	mysql_query($q1) or die(mysql_error());
}

//get the settings
$q1 = "select * from job_settings";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);

?>
<br /><br />
<form method=post>
<table align="center" width="400" class="BlackText">
  <tr>
    <td height="40" colspan="2" align="center" class="HeaderClass"><font size="3"><b>Settings</b></font></td>
  </tr>
</table>

<table align=center width=460 class=BlackLink>
<tr>
	<td width=200 align=left>Paypal.com email:</td>
	<td><input type=text name=pp value="<?php echo $a1[paypal]; ?>" size=45></td>
</tr>
<tr>
	<td width=200 align=left>Contacts email:</td>
	<td><input type=text name=ce value="<?php echo $a1[ContactEmail]; ?>" size=45></td>
</tr>
<tr>
	<td width=200 align=left>Adsense ID:</td>
	<td><input type=text name=adsense value="<?php echo $a1[adsense]; ?>" size=45></td>
</tr>
<tr>
	<td valign=top align=left>FAQs:</td>
	<td><textarea name=faq rows=4 cols=40><?php echo $a1[faq]; ?></textarea></td>
</tr>
<tr>
	<td valign=top align=left>About us:</td>
	<td><textarea name=about rows=4 cols=40><?php echo $a1[about]; ?></textarea></td>
</tr>
<tr>
    <td valign=top align=left>Job Hunting Tips:</td>
    <td><textarea name=tips rows=4 cols=40><?php echo $a1[tips]; ?></textarea></td>
</tr>
<tr>
	<td valign=top align=left>Privacy:</td>
	<td><textarea name=privacy rows=4 cols=40><?php echo $a1[privacy]; ?></textarea></td>
</tr>
<tr>
	<td align=left>Counters: </td>
	<td>
		<select name=counters>
			<option value="on" <?php if ($a1[counters] == "on") { echo "selected"; } ?>>On</option>
			<option value="off" <?php if ($a1[counters] == "off") { echo "selected"; } ?>>Off</option>
		</select>
	</td>
</tr>
<tr>
	<td></td>
	<td>
		<input type=submit name=s1 value="Update Settings">
	</td>
</tr>
</table>
</form>

<?php include_once("../footer.php"); ?>